package com.itheima.demo06.Predicate;

import java.util.function.Predicate;

public class Demo02Predicate_or {
    public static void main(String[] args) {
        String s = "abcde";
        boolean b = checkString(s, str -> str.length() > 5, str -> str.contains("a"));
        System.out.println(b);
    }

    public static boolean checkString(String s, Predicate<String> pre1, Predicate<String> pre2) {
        /*return pre1.test(s) || pre2.test(s);*/
        return pre1.or(pre2).test(s);
    }
}
